[#ftl]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>[#assign module="clientapps"][#assign moduleName="客户应用"]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]</title>
<script type="text/javascript" src="${base}/commonjs/jquery1.7.2/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery-forms.js"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/artDialog.source.js?skin=blue"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/plugins/iframeTools.source.js"></script>
<script type="text/javascript" src="${base}/commonjs/datepicker/WdatePicker.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery.itembox.js"></script>
<script type="text/javascript">
var resources = [];
var authorities = [];

$(function(){
	$("#btadditem").bind("click", function(){
		$("#additemform").ajaxForm({
			dataType: "json",
			success: function(json){
				if(!json.success){
					art.dialog.through({
						title: "[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]失败",
						icon: "error",
						content: "[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]失败！可能是因为用户名与已有数据重复！请输入另外的用户名",//json.err,
						width: 250,
						height: 150,
						background: '#EEE', // 背景色
						opacity: 0.05,	// 透明度
						lock: true,
						ok: true
					});
				}else{
					try{
						art.dialog.top.frames["_iframe"].window.flexGridReload(".flexme3");
					}catch(e){
						art.dialog.top.window.flexGridReload(".flexme3");
					}
					art.dialog.close();
				}
			}
		});
	});
});
</script>
</head>
<body>
<h3>[#if (item.id)??]编辑${moduleName}信息[#else]添加新${moduleName}[/#if]</h3>
<form id="additemform" action="${base}/${module}/${((item.id)??)?string('edit','add')}" method="POST">
<input type="hidden" name="id" value=${(item.id)!}>
<div style="clear: both">${moduleName}名:<input type="text" name="name" value="${(item.name)!}"/></div>[#if (item.id)??]
<div style="clear: both">ClientId:<input type="text" style="width:250px" value="${(item.clientId)!}" disabled/></div>
<div style="clear: both">ClientSecret:<input type="text" style="width:250px" value="${(item.clientSecret)!}" disabled/></div>[/#if]
<div style="clear: both">描述:<textarea rows="3" cols="35" name="description">${(item.description)!}</textarea></div></div>
<input type="submit" value="[#if (item.id)??]保存${moduleName}信息[#else]保存新${moduleName}[/#if]" id="btadditem">
</form>
<!--input type="button" value="Resources" onclick="showResult()"-->

</body>
</html>